<!-- <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <img src="./img/0.png" alt="">
    <img src="./img/0.png" alt="">
    <img src="./img/0.png" alt="">
    <img src="./img/0.png" alt="">
    <img src="./img/0.png" alt="">
    <span id="show"></span>
    <script> -->
<!-- // function dates(date) {
        //     var year = date.getFullYear();
        //     var month = date.getMonth() + 1;
        //     var dates = date.getDate();

        //     var h = date.getHours();
        //     // 判断h这个是是否值小于 10的值，比如h = 9,应该显示W为 09
        //     h = h >= 10 ? h : '0' + h;

        //     var m = date.getMinutes();
        //     m = m >= 10 ? m : '0' + m;

        //     var s = date.getSeconds();
        //     s = s >= 10 ? s : '0' + s;

        //     var day = date.getDay(); //0-6  0表示星期天

        //     var arr = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']

        //     // 把格式化号的 时间返回
        //     return year + '-' + month + '-' + dates + ' ' + h + ':' + m + ':' + s + '  ' + arr[day]
        // }
        // function dates(date) {
        //     var year = date.getFullYear();
        //     var month = date.getMonth();
        //     var day = date.getDate();
        //     var week = date.getDay();
        //     var hour = date.getHours();
        //     hour = hour >= 10 ? hour : '0' + hour;
        //     var min = date.getMinutes();
        //     min = min >= 10 ? min : '0' + min;
        //     var second = date.getSeconds();
        //     second = second >= 10 ? second : '0' + second
        //     return hour + ':' + min + ':' + second
        // }
        // var date = new Date();
        // // 只是把当前的时间显示在页面中
        // show.innerHTML = dates(date);
        // var imgs = document.getElementsByTagName('img')
        // // 让时间走动起来 必须使用定时器
        // setInterval(function () {
        //     // 每隔一秒获取一次最新的时间，把最新的时间显示在 show标签中
        //     var date = new Date();
        //     show.innerHTML = dates(date);
        // }, 1000) -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    </style>
</head>

<body>
    <img src="img/0.png" alt="">
    <img src="img/0.png" alt="">
    :
    <img src="img/0.png" alt="">
    <img src="img/0.png" alt="">
    :
    <img src="img/0.png" alt="">
    <img src="img/0.png" alt="">
    <script>
        window.onload = function () {
            clock();
        }
        function clock() {
            setInterval(function () {
                // 1）、获取当前时间
                var d = new Date();
                // 2）、取出当前时间里的，小时的十位和个位；分钟的十位和个位；秒的十位和个位；
                var hoursShi = parseInt(d.getHours() / 10);
                var hoursGe = d.getHours() % 10;
                var minutesShi = parseInt(d.getMinutes() / 10);
                var minutesGe = d.getMinutes() % 10;
                var secondsShi = parseInt(d.getSeconds() / 10);
                var secondsGe = d.getSeconds() % 10;
                // 3）、改变img标签的src属性
                var imgs = document.getElementsByTagName('img');
                for (i = 0; i < imgs.length; i++) {
                    imgs[0].src = "img/" + hoursShi + ".png";
                    imgs[1].src = "img/" + hoursGe + ".png";
                    imgs[2].src = "img/" + minutesShi + ".png";
                    imgs[3].src = "img/" + minutesGe + ".png";
                    imgs[4].src = "img/" + secondsShi + ".png";
                    imgs[5].src = "img/" + secondsGe + ".png";
                }
            }, 1000);
        }



    </script>
</body>

</html>

</body>

</html>